﻿using System;
using System.Collections.Generic;
using System.Text;
using Vortex;
using Vortex.Drawing;

namespace Vortex.Tutorials.EmptyGame {

    ///<summary>Simplest game application based on Vortex2D.NET game framework. You can learn how to setup basic window properties and clear background.</summary>
    public class EmptyGame : Vortex.Game {
        ///<summary>You can place window configuring code in class constructor</summary>
        public EmptyGame() {
            /*
             *  Configuring of window parameters is easy. All you need is modify Game.Window object properties or call methods
             *  All changes will be applied before next frame will be started
             */

			//configuring window size
			Game.Window.Size = new System.Drawing.Size(720, 500);
			//setting window title (it could be changed during game flow like all other properties)
			Game.Window.Title = "Empty Game Application";
			//changing of window location is desktop space. Now it is just a property.
			Game.Window.Location = new System.Drawing.Point(100, 100);
			//setting fullscreen/windowed mode
			Game.Window.Fullscreen = false;
			//limiting framerate setting vertical blank sync
			Game.Window.VerticalSync = true;
			//disable switching of display mode on Alt + Enter
			Game.ChangeDisplayModeOnAltEnter = false;
        }

        ///<summary>Load() is method where most of resource loading code should be placed</summary>
        protected override void Load () {
        }

        ///<summary>Unload() is called before game exit. All resource should be freed here</summary>
        protected override void Unload () {

        }

        ///<summary>Update() is called each frame to prcess some per-frame calculation like: AI, physics, animation etc</summary>
        protected override void Update (GameTime time) {

        }

        ///<summary>Render() is called each frame to update graphics content of frame. All drawing code should be here</summary>
        protected override void Render (Canvas2D canvas) {
            //Canvas2D.Clear method forcess cleanup of drawing target. There are few more overloads to clear only part of target
            //ColorU is representation of 4-component color packed into Uint (byte-per component). It is most usable type of color
            canvas.Clear(ColorU.Black);            
        }

    }

}
